/**
 * 
 */
package com.sci.web.action.datareportseason;

import javax.annotation.Resource;

import com.sci.web.action.util.BaseAction;
import com.sci.web.bean.Enterprise_Authentication;
import com.sci.web.dao.DataReportMEnterpriseEuthenticationDao;

/**
 * @author  BaiFuyou
 * @date: Nov 5, 2011 6:34:10 PM
 * 
 * 新增一条数据
 */
public class AddNewEnterpriseAuthentication_BaseInfoAction extends BaseAction {

	/**
	 *
	 */
	private static final long serialVersionUID = -6165933161134735972L;
	@Resource
	private DataReportMEnterpriseEuthenticationDao dataReportMEnterpriseEuthenticationDao;
	private int uid;
	private String year;
	private int type;
	private int authentication_type;
	private String authentication_name;
	private String authentication_department;
	private String authentication_time;
	
	/**
	 * @return the uid
	 */
	public int getUid() {
		return uid;
	}
	/**
	 * @param uid the uid to set
	 */
	public void setUid(int uid) {
		this.uid = uid;
	}
	/**
	 * @return the year
	 */
	public String getYear() {
		return year;
	}
	/**
	 * @param year the year to set
	 */
	public void setYear(String year) {
		this.year = year;
	}
	/**
	 * @return the type
	 */
	public int getType() {
		return type;
	}
	/**
	 * @param type the type to set
	 */
	public void setType(int type) {
		this.type = type;
	}
	/**
	 * @return the authentication_type
	 */
	public int getAuthentication_type() {
		return authentication_type;
	}
	/**
	 * @param authentication_type the authentication_type to set
	 */
	public void setAuthentication_type(int authentication_type) {
		this.authentication_type = authentication_type;
	}
	/**
	 * @return the authentication_name
	 */
	public String getAuthentication_name() {
		return authentication_name;
	}
	/**
	 * @param authentication_name the authentication_name to set
	 */
	public void setAuthentication_name(String authentication_name) {
		this.authentication_name = authentication_name;
	}
	/**
	 * @return the authentication_department
	 */
	public String getAuthentication_department() {
		return authentication_department;
	}
	/**
	 * @param authentication_department the authentication_department to set
	 */
	public void setAuthentication_department(String authentication_department) {
		this.authentication_department = authentication_department;
	}
	/**
	 * @return the authentication_time
	 */
	public String getAuthentication_time() {
		return authentication_time;
	}
	/**
	 * @param authentication_time the authentication_time to set
	 */
	public void setAuthentication_time(String authentication_time) {
		this.authentication_time = authentication_time;
	}
	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		Enterprise_Authentication ea = new Enterprise_Authentication();
		ea.setAuthentication_check_pass(3);
		ea.setAuthentication_department(authentication_department);
		ea.setAuthentication_id(0);
		ea.setAuthentication_type(authentication_type);
		ea.setAuthentication_is_new(0);
		ea.setAuthentication_name(authentication_name);
		ea.setAuthentication_time(authentication_time.trim().substring(0,10));
		ea.setAuthentication_type_sb(type);
		ea.setDeclare_year(year);
		ea.setEditable(1);
		ea.setEnterprise_id(dataReportMEnterpriseEuthenticationDao.getEnterpriseBaseId(uid));
		if(dataReportMEnterpriseEuthenticationDao.insertNewEnterprise_AuthenticationData(ea)){
			super.outPrint("ok");
		}else{
			super.outPrint("fail");
		}
		return "json";
	}

}
